<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>浏览器滚动到</title>
    <style>
      body {
        width: 3000px;
        height: 4000px;
      }
      button {
        position: fixed;
        bottom: 50px;
        right: 50px;
      }
    </style>
</head>
<body>
<button id="go">go</button>
<script>
  //移动到
  // go.onclick =function () {
  //   window.scrollTo(300,400);
  // }
  //平滑的移动
  go.onclick = function () {
    window.scrollTo({
      left:300,
      top:400,
      //平滑的移动
      behavior:"smooth",
    })
  }
</script>
</body>
</html>